import java.io.*;

public class Iterators {
  public static InputStream fileIterator(File file) throws FileNotFoundException {
    return new BufferedInputStream(new FileInputStream(file), 16);
  }

  public static void main(String[] args) throws IOException {
    File file = new File("test");
    InputStream i = fileIterator(file);
    byte[] b = new byte[16];
    for (int num = i.read(b); num != -1; num = i.read(b)) {
      System.out.println(">>>");
      System.out.write(b);
    }
    i.close();
  }
}
